Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment 2 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Assignment 2 #33

wants to merge 1 commit into from

Conversation

SZanetti
Copy link

I was confused about the submission for this homework assignment. On Canvas, the assignment still said to wait before submitting:
"NOTE: This is the first part of this assignment. I'll be adding additional exercises after we cover new material in class.

Because of this, DO NOT submit this assignment yet."

I understood this to believe that we were not supposed to submit this assignment until we'd completed part B of the assignment, which is not due until the 25th. Because of this, I do not submit this pull request on time.

I understand if you cannot accept this late assignment, but I hope that you will reconsider.

Thank you,
Story Zanetti

@pragdave
Copy link
Contributor

Story:

In class I explained that I'd changed my mind, in order to give people
feedback earlier. The assignment in Canvas had the 18th as the due date. I
also reminded people to get their assignments in in the preceding two
lectures.

However, your local commit history does show that you committed to your own
repository on the 18th.

I'n trying very hard to be fair, here, but in this case I'm going to give
you the benefit of the doubt and grade it, but with a 10 point penalty.

Regards

Dave Thomas

On Wed, Sep 21, 2016 at 2:10 PM, Story Zanetti [email protected]
wrote:

I was confused about the submission for this homework assignment. On
Canvas, the assignment still said to wait before submitting:
"NOTE: This is the first part of this assignment. I'll be adding
additional exercises after we cover new material in class.

Because of this, DO NOT submit this assignment yet."

I understood this to believe that we were not supposed to submit this
assignment until we'd completed part B of the assignment, which is not due
until the 25th. Because of this, I do not submit this pull request on time.

I understand if you cannot accept this late assignment, but I hope that
you will reconsider.

Thank you,

Story Zanetti

You can view, comment on, or merge this pull request online at:

#33
Commit Summary

  • Added code

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#33, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAApmIoKm8SPzCiq_gibjcBxmzWwW3_Gks5qsYEfgaJpZM4KDK2N
.

@SZanetti
Copy link
Author

Hello!

Thank you very much. I completely understand the points you took off. I
sincerely apologize for my confusion. I will make sure this doesn't happen
again.

Thank you,
Story Zanetti

On Wed, Sep 21, 2016 at 2:45 PM, pragdave [email protected] wrote:

Story:

In class I explained that I'd changed my mind, in order to give people
feedback earlier. The assignment in Canvas had the 18th as the due date. I
also reminded people to get their assignments in in the preceding two
lectures.

However, your local commit history does show that you committed to your own
repository on the 18th.

I'n trying very hard to be fair, here, but in this case I'm going to give
you the benefit of the doubt and grade it, but with a 10 point penalty.

Regards

Dave Thomas

On Wed, Sep 21, 2016 at 2:10 PM, Story Zanetti [email protected]
wrote:

I was confused about the submission for this homework assignment. On
Canvas, the assignment still said to wait before submitting:
"NOTE: This is the first part of this assignment. I'll be adding
additional exercises after we cover new material in class.

Because of this, DO NOT submit this assignment yet."

I understood this to believe that we were not supposed to submit this
assignment until we'd completed part B of the assignment, which is not
due
until the 25th. Because of this, I do not submit this pull request on
time.

I understand if you cannot accept this late assignment, but I hope that
you will reconsider.

Thank you,

Story Zanetti

You can view, comment on, or merge this pull request online at:

#33
Commit Summary

  • Added code

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#33, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAApmIoKm8SPzCiq_
gibjcBxmzWwW3_Gks5qsYEfgaJpZM4KDK2N>
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#33 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADK4Fh3kvKnI6wIM8rJup7iWMzXO7Mxcks5qsYlMgaJpZM4KDK2N
.

@@ -36,7 +36,7 @@ defmodule Ex01 do
# Write a function that adds two numbers using fn syntax #
##########################################################

sum2a = your_anonymous_function(1, 2)
sum2a = fn (a,b) -> a + b end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -47,7 +47,7 @@ defmodule Ex01 do
# Write a function that adds two numbers using & syntax #
##########################################################

sum2b = your_anonymous_function(1, 2)
sum2b = &( &1 + &2 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -60,7 +60,7 @@ defmodule Ex01 do
# no explicit + operators in your function #
#####################################################################

sum3a = your_anonymous_function(1, 2, 3)
sum3a = fn (a, b, c) -> sum2a.(sum2a.(a, b), c) end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -71,7 +71,7 @@ defmodule Ex01 do
# Do the same using the & notation #
####################################

sum3b = your_anonymous_function
sum3b = &( sum2b.(sum2b.(&1, &2), &3) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -86,7 +86,7 @@ defmodule Ex01 do
# function. The examples below will make this clearer :) #
########################################################################

create_adder = your_anonymous_function(1)
create_adder = fn (a) -> fn (b) -> a + b end end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10

@@ -101,7 +125,30 @@ defmodule Ex03 do

"""

def list_equal . . . "your code"
def list_equal([], []) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3

I think you'v made this too complicated. You can do the checking using pattern matching.

I was also a little confused by two functions called list_equal that do different things.

Here's my approach:

   def list_equal([], []), do: true
  def list_equal([h1], [h1]), do: true
  def list_equal([h1 | tail1], [h1 | tail2]), do: list_equal(tail1, tail2)
  def list_equal(a,b), do: false

@@ -149,8 +196,15 @@ defmodule Ex03 do
Think a little about a nice way to lay this code out.
"""

def won . . . "your code"

def won({a, _, _, a, _, _, a, _, _}), do: a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -39,7 +39,7 @@ defmodule Ex04 do
[ 1, 2, 3, 4, 5 ]

"""
def reverse . . . "your code"
def reverse(list), do: reduce(list, [], &[ &1 | &2 ])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

@@ -55,7 +55,15 @@ defmodule Ex04 do

"""

def min . . . "your code"
def min(list) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5

although I'd like to see the "min" part broken out into its own function.

@@ -75,7 +83,26 @@ defmodule Ex04 do
return value will be the thing you have to manipulate.
"""

def even_odd . . . "your code"
def add_if_even(value, result) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6

I have two issues here. First, you're traversing the list twice. Second, there's a lot of duplication between add_if_even and add_if_odd. You could have parameterized a more general function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants